<?php
	/**
	 * The abstract TablePaypalRequestOutGen class defined here is
	 * code-generated and contains all the basic CRUD-type functionality as well as
	 * basic methods to handle relationships and index-based loading.
	 *
	 * To use, you should use the TablePaypalRequestOut subclass which
	 * extends this TablePaypalRequestOutGen class.
	 *
	 * Because subsequent re-code generations will overwrite any changes to this
	 * file, you should leave this file unaltered to prevent yourself from losing
	 * any information or code changes.  All customizations should be done by
	 * overriding existing or implementing new methods, properties and variables
	 * in the TablePaypalRequestOut class.
	 * 
	 * @package My Application
	 * @subpackage GeneratedDataObjects
	 * @property-read integer $Id the value for intId (Read-Only PK)
	 * @property integer $TransactionId the value for intTransactionId 
	 * @property integer $ProcessTransactionId the value for intProcessTransactionId 
	 * @property integer $UserId the value for intUserId (Not Null)
	 * @property integer $Currency the value for intCurrency (Not Null)
	 * @property integer $AmountWithdrawFromSite the value for intAmountWithdrawFromSite (Not Null)
	 * @property integer $AmountWithdrawFromPaypalAccount the value for intAmountWithdrawFromPaypalAccount (Not Null)
	 * @property integer $FeePaypal the value for intFeePaypal (Not Null)
	 * @property string $PaypalEmail the value for strPaypalEmail (Not Null)
	 * @property string $Username the value for strUsername (Not Null)
	 * @property QDateTime $RequestDate the value for dttRequestDate 
	 * @property QDateTime $ProcessDate the value for dttProcessDate 
	 * @property string $TransactionIdMasspay the value for strTransactionIdMasspay 
	 * @property string $TransactionIdPaypal the value for strTransactionIdPaypal 
	 * @property integer $Status the value for intStatus (Not Null)
	 * @property integer $Amount the value for intAmount (Not Null)
	 * @property integer $ReturnedAmount the value for intReturnedAmount 
	 * @property TableUserProject $User the value for the TableUserProject object referenced by intUserId (Not Null)
	 * @property-read boolean $__Restored whether or not this object was restored from the database (as opposed to created new)
	 */
	class TablePaypalRequestOutGen extends QBaseClass {

		///////////////////////////////////////////////////////////////////////
		// PROTECTED MEMBER VARIABLES and TEXT FIELD MAXLENGTHS (if applicable)
		///////////////////////////////////////////////////////////////////////
		
		/**
		 * Protected member variable that maps to the database PK Identity column table_paypal_request_out.id
		 * @var integer intId
		 */
		protected $intId;
		const IdDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.transaction_id
		 * @var integer intTransactionId
		 */
		protected $intTransactionId;
		const TransactionIdDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.process_transaction_id
		 * @var integer intProcessTransactionId
		 */
		protected $intProcessTransactionId;
		const ProcessTransactionIdDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.user_id
		 * @var integer intUserId
		 */
		protected $intUserId;
		const UserIdDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.currency
		 * @var integer intCurrency
		 */
		protected $intCurrency;
		const CurrencyDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.amount_withdraw_from_site
		 * @var integer intAmountWithdrawFromSite
		 */
		protected $intAmountWithdrawFromSite;
		const AmountWithdrawFromSiteDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.amount_withdraw_from_paypal_account
		 * @var integer intAmountWithdrawFromPaypalAccount
		 */
		protected $intAmountWithdrawFromPaypalAccount;
		const AmountWithdrawFromPaypalAccountDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.fee_paypal
		 * @var integer intFeePaypal
		 */
		protected $intFeePaypal;
		const FeePaypalDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.paypal_email
		 * @var string strPaypalEmail
		 */
		protected $strPaypalEmail;
		const PaypalEmailMaxLength = 200;
		const PaypalEmailDefault = null;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.username
		 * @var string strUsername
		 */
		protected $strUsername;
		const UsernameMaxLength = 100;
		const UsernameDefault = null;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.request_date
		 * @var QDateTime dttRequestDate
		 */
		protected $dttRequestDate;
		const RequestDateDefault = null;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.process_date
		 * @var QDateTime dttProcessDate
		 */
		protected $dttProcessDate;
		const ProcessDateDefault = null;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.transaction_id_masspay
		 * @var string strTransactionIdMasspay
		 */
		protected $strTransactionIdMasspay;
		const TransactionIdMasspayMaxLength = 100;
		const TransactionIdMasspayDefault = null;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.transaction_id_paypal
		 * @var string strTransactionIdPaypal
		 */
		protected $strTransactionIdPaypal;
		const TransactionIdPaypalMaxLength = 100;
		const TransactionIdPaypalDefault = null;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.status
		 * @var integer intStatus
		 */
		protected $intStatus;
		const StatusDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.amount
		 * @var integer intAmount
		 */
		protected $intAmount;
		const AmountDefault = 0;


		/**
		 * Protected member variable that maps to the database column table_paypal_request_out.returned_amount
		 * @var integer intReturnedAmount
		 */
		protected $intReturnedAmount;
		const ReturnedAmountDefault = 0;


		/**
		 * Protected array of virtual attributes for this object (e.g. extra/other calculated and/or non-object bound
		 * columns from the run-time database query result for this object).  Used by InstantiateDbRow and
		 * GetVirtualAttribute.
		 * @var string[] $__strVirtualAttributeArray
		 */
		protected $__strVirtualAttributeArray = array();

		/**
		 * Protected internal member variable that specifies whether or not this object is Restored from the database.
		 * Used by Save() to determine if Save() should perform a db UPDATE or INSERT.
		 * @var bool __blnRestored;
		 */
		protected $__blnRestored;




		///////////////////////////////
		// PROTECTED MEMBER OBJECTS
		///////////////////////////////

		/**
		 * Protected member variable that contains the object pointed by the reference
		 * in the database column table_paypal_request_out.user_id.
		 *
		 * NOTE: Always use the User property getter to correctly retrieve this TableUserProject object.
		 * (Because this class implements late binding, this variable reference MAY be null.)
		 * @var TableUserProject objUser
		 */
		protected $objUser;





		///////////////////////////////
		// CLASS-WIDE LOAD AND COUNT METHODS
		///////////////////////////////

		/**
		 * Static method to retrieve the Database object that owns this class.
		 * @return QDatabaseBase reference to the Database object that can query this class
		 */
		public static function GetDatabase() {
			return QApplication::$Database[1];
		}

		/**
		 * Load a TablePaypalRequestOut from PK Info
		 * @param integer $intId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut
		 */
		public static function Load($intId, $objOptionalClauses = null) {
			// Use QuerySingle to Perform the Query
			return TablePaypalRequestOut::QuerySingle(
				QQ::AndCondition(
					QQ::Equal(QQN::TablePaypalRequestOut()->Id, $intId)
				),
				$objOptionalClauses
			);
		}

		/**
		 * Load all TablePaypalRequestOuts
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		 */
		public static function LoadAll($objOptionalClauses = null) {
			if (func_num_args() > 1) {
				throw new QCallerException("LoadAll must be called with an array of optional clauses as a single argument");
			}
			// Call TablePaypalRequestOut::QueryArray to perform the LoadAll query
			try {
				return TablePaypalRequestOut::QueryArray(QQ::All(), $objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count all TablePaypalRequestOuts
		 * @return int
		 */
		public static function CountAll() {
			// Call TablePaypalRequestOut::QueryCount to perform the CountAll query
			return TablePaypalRequestOut::QueryCount(QQ::All());
		}




		///////////////////////////////
		// QCUBED QUERY-RELATED METHODS
		///////////////////////////////

		/**
		 * Internally called method to assist with calling Qcubed Query for this class
		 * on load methods.
		 * @param QQueryBuilder &$objQueryBuilder the QueryBuilder object that will be created
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause object or array of QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with (sending in null will skip the PrepareStatement step)
		 * @param boolean $blnCountOnly only select a rowcount
		 * @return string the query statement
		 */
		protected static function BuildQueryStatement(&$objQueryBuilder, QQCondition $objConditions, $objOptionalClauses, $mixParameterArray, $blnCountOnly) {
			// Get the Database Object for this Class
			$objDatabase = TablePaypalRequestOut::GetDatabase();

			// Create/Build out the QueryBuilder object with TablePaypalRequestOut-specific SELET and FROM fields
			$objQueryBuilder = new QQueryBuilder($objDatabase, 'table_paypal_request_out');
			TablePaypalRequestOut::GetSelectFields($objQueryBuilder);
			$objQueryBuilder->AddFromItem('table_paypal_request_out');

			// Set "CountOnly" option (if applicable)
			if ($blnCountOnly)
				$objQueryBuilder->SetCountOnlyFlag();

			// Apply Any Conditions
			if ($objConditions)
				try {
					$objConditions->UpdateQueryBuilder($objQueryBuilder);
				} catch (QCallerException $objExc) {
					$objExc->IncrementOffset();
					throw $objExc;
				}

			// Iterate through all the Optional Clauses (if any) and perform accordingly
			if ($objOptionalClauses) {
				if ($objOptionalClauses instanceof QQClause)
					$objOptionalClauses->UpdateQueryBuilder($objQueryBuilder);
				else if (is_array($objOptionalClauses))
					foreach ($objOptionalClauses as $objClause)
						$objClause->UpdateQueryBuilder($objQueryBuilder);
				else
					throw new QCallerException('Optional Clauses must be a QQClause object or an array of QQClause objects');
			}

			// Get the SQL Statement
			$strQuery = $objQueryBuilder->GetStatement();

			// Prepare the Statement with the Query Parameters (if applicable)
			if ($mixParameterArray) {
				if (is_array($mixParameterArray)) {
					if (count($mixParameterArray))
						$strQuery = $objDatabase->PrepareStatement($strQuery, $mixParameterArray);

					// Ensure that there are no other Unresolved Named Parameters
					if (strpos($strQuery, chr(QQNamedValue::DelimiterCode) . '{') !== false)
						throw new QCallerException('Unresolved named parameters in the query');
				} else
					throw new QCallerException('Parameter Array must be an array of name-value parameter pairs');
			}

			// Return the Objects
			return $strQuery;
		}

		/**
		 * Static Qcubed Query method to query for a single TablePaypalRequestOut object.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return TablePaypalRequestOut the queried object
		 */
		public static function QuerySingle(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = TablePaypalRequestOut::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
			
			// Perform the Query, Get the First Row, and Instantiate a new TablePaypalRequestOut object
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);
			
			// Do we have to expand anything?
			if ($objQueryBuilder->ExpandAsArrayNodes) {
				$objToReturn = array();
				while ($objDbRow = $objDbResult->GetNextRow()) {
					$objItem = TablePaypalRequestOut::InstantiateDbRow($objDbRow, null, $objQueryBuilder->ExpandAsArrayNodes, $objToReturn, $objQueryBuilder->ColumnAliasArray);
					if ($objItem)
						$objToReturn[] = $objItem;					
				}			
				// Since we only want the object to return, lets return the object and not the array.
				return $objToReturn[0];
			} else {
				// No expands just return the first row
				$objToReturn = null;
				while ($objDbRow = $objDbResult->GetNextRow())
					$objToReturn = TablePaypalRequestOut::InstantiateDbRow($objDbRow, null, null, null, $objQueryBuilder->ColumnAliasArray);
			}
			
			return $objToReturn;
		}

		/**
		 * Static Qcubed Query method to query for an array of TablePaypalRequestOut objects.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return TablePaypalRequestOut[] the queried objects as an array
		 */
		public static function QueryArray(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = TablePaypalRequestOut::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query and Instantiate the Array Result
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);
			return TablePaypalRequestOut::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
		}

		/**
		 * Static Qcubed Query method to query for a count of TablePaypalRequestOut objects.
		 * Uses BuildQueryStatment to perform most of the work.
		 * @param QQCondition $objConditions any conditions on the query, itself
		 * @param QQClause[] $objOptionalClausees additional optional QQClause objects for this query
		 * @param mixed[] $mixParameterArray a array of name-value pairs to perform PrepareStatement with
		 * @return integer the count of queried objects as an integer
		 */
		public static function QueryCount(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null) {
			// Get the Query Statement
			try {
				$strQuery = TablePaypalRequestOut::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, true);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Perform the Query and return the row_count
			$objDbResult = $objQueryBuilder->Database->Query($strQuery);

			// Figure out if the query is using GroupBy
			$blnGrouped = false;

			if ($objOptionalClauses) foreach ($objOptionalClauses as $objClause) {
				if ($objClause instanceof QQGroupBy) {
					$blnGrouped = true;
					break;
				}
			}

			if ($blnGrouped)
				// Groups in this query - return the count of Groups (which is the count of all rows)
				return $objDbResult->CountRows();
			else {
				// No Groups - return the sql-calculated count(*) value
				$strDbRow = $objDbResult->FetchRow();
				return QType::Cast($strDbRow[0], QType::Integer);
			}
		}

		public static function QueryArrayCached(QQCondition $objConditions, $objOptionalClauses = null, $mixParameterArray = null, $blnForceUpdate = false) {
			// Get the Database Object for this Class
			$objDatabase = TablePaypalRequestOut::GetDatabase();

			$strQuery = TablePaypalRequestOut::BuildQueryStatement($objQueryBuilder, $objConditions, $objOptionalClauses, $mixParameterArray, false);
			
			$objCache = new QCache('qquery/tablepaypalrequestout', $strQuery);
			$cacheData = $objCache->GetData();
			
			if (!$cacheData || $blnForceUpdate) {
				$objDbResult = $objQueryBuilder->Database->Query($strQuery);
				$arrResult = TablePaypalRequestOut::InstantiateDbResult($objDbResult, $objQueryBuilder->ExpandAsArrayNodes, $objQueryBuilder->ColumnAliasArray);
				$objCache->SaveData(serialize($arrResult));
			} else {
				$arrResult = unserialize($cacheData);
			}
			
			return $arrResult;
		}

		/**
		 * Updates a QQueryBuilder with the SELECT fields for this TablePaypalRequestOut
		 * @param QQueryBuilder $objBuilder the Query Builder object to update
		 * @param string $strPrefix optional prefix to add to the SELECT fields
		 */
		public static function GetSelectFields(QQueryBuilder $objBuilder, $strPrefix = null) {
			if ($strPrefix) {
				$strTableName = $strPrefix;
				$strAliasPrefix = $strPrefix . '__';
			} else {
				$strTableName = 'table_paypal_request_out';
				$strAliasPrefix = '';
			}

			$objBuilder->AddSelectItem($strTableName, 'id', $strAliasPrefix . 'id');
			$objBuilder->AddSelectItem($strTableName, 'transaction_id', $strAliasPrefix . 'transaction_id');
			$objBuilder->AddSelectItem($strTableName, 'process_transaction_id', $strAliasPrefix . 'process_transaction_id');
			$objBuilder->AddSelectItem($strTableName, 'user_id', $strAliasPrefix . 'user_id');
			$objBuilder->AddSelectItem($strTableName, 'currency', $strAliasPrefix . 'currency');
			$objBuilder->AddSelectItem($strTableName, 'amount_withdraw_from_site', $strAliasPrefix . 'amount_withdraw_from_site');
			$objBuilder->AddSelectItem($strTableName, 'amount_withdraw_from_paypal_account', $strAliasPrefix . 'amount_withdraw_from_paypal_account');
			$objBuilder->AddSelectItem($strTableName, 'fee_paypal', $strAliasPrefix . 'fee_paypal');
			$objBuilder->AddSelectItem($strTableName, 'paypal_email', $strAliasPrefix . 'paypal_email');
			$objBuilder->AddSelectItem($strTableName, 'username', $strAliasPrefix . 'username');
			$objBuilder->AddSelectItem($strTableName, 'request_date', $strAliasPrefix . 'request_date');
			$objBuilder->AddSelectItem($strTableName, 'process_date', $strAliasPrefix . 'process_date');
			$objBuilder->AddSelectItem($strTableName, 'transaction_id_masspay', $strAliasPrefix . 'transaction_id_masspay');
			$objBuilder->AddSelectItem($strTableName, 'transaction_id_paypal', $strAliasPrefix . 'transaction_id_paypal');
			$objBuilder->AddSelectItem($strTableName, 'status', $strAliasPrefix . 'status');
			$objBuilder->AddSelectItem($strTableName, 'amount', $strAliasPrefix . 'amount');
			$objBuilder->AddSelectItem($strTableName, 'returned_amount', $strAliasPrefix . 'returned_amount');
		}



		///////////////////////////////
		// INSTANTIATION-RELATED METHODS
		///////////////////////////////

		/**
		 * Instantiate a TablePaypalRequestOut from a Database Row.
		 * Takes in an optional strAliasPrefix, used in case another Object::InstantiateDbRow
		 * is calling this TablePaypalRequestOut::InstantiateDbRow in order to perform
		 * early binding on referenced objects.
		 * @param DatabaseRowBase $objDbRow
		 * @param string $strAliasPrefix
		 * @param string $strExpandAsArrayNodes
		 * @param QBaseClass $arrPreviousItem
		 * @param string[] $strColumnAliasArray
		 * @return TablePaypalRequestOut
		*/
		public static function InstantiateDbRow($objDbRow, $strAliasPrefix = null, $strExpandAsArrayNodes = null, $arrPreviousItems = null, $strColumnAliasArray = array()) {
			// If blank row, return null
			if (!$objDbRow) {
				return null;
			}

			// Create a new instance of the TablePaypalRequestOut object
			$objToReturn = new TablePaypalRequestOut();
			$objToReturn->__blnRestored = true;

			$strAliasName = array_key_exists($strAliasPrefix . 'id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'id'] : $strAliasPrefix . 'id';
			$objToReturn->intId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'transaction_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'transaction_id'] : $strAliasPrefix . 'transaction_id';
			$objToReturn->intTransactionId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'process_transaction_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'process_transaction_id'] : $strAliasPrefix . 'process_transaction_id';
			$objToReturn->intProcessTransactionId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'user_id', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'user_id'] : $strAliasPrefix . 'user_id';
			$objToReturn->intUserId = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'currency', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'currency'] : $strAliasPrefix . 'currency';
			$objToReturn->intCurrency = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'amount_withdraw_from_site', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'amount_withdraw_from_site'] : $strAliasPrefix . 'amount_withdraw_from_site';
			$objToReturn->intAmountWithdrawFromSite = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'amount_withdraw_from_paypal_account', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'amount_withdraw_from_paypal_account'] : $strAliasPrefix . 'amount_withdraw_from_paypal_account';
			$objToReturn->intAmountWithdrawFromPaypalAccount = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'fee_paypal', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'fee_paypal'] : $strAliasPrefix . 'fee_paypal';
			$objToReturn->intFeePaypal = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'paypal_email', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'paypal_email'] : $strAliasPrefix . 'paypal_email';
			$objToReturn->strPaypalEmail = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'username', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'username'] : $strAliasPrefix . 'username';
			$objToReturn->strUsername = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'request_date', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'request_date'] : $strAliasPrefix . 'request_date';
			$objToReturn->dttRequestDate = $objDbRow->GetColumn($strAliasName, 'DateTime');
			$strAliasName = array_key_exists($strAliasPrefix . 'process_date', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'process_date'] : $strAliasPrefix . 'process_date';
			$objToReturn->dttProcessDate = $objDbRow->GetColumn($strAliasName, 'DateTime');
			$strAliasName = array_key_exists($strAliasPrefix . 'transaction_id_masspay', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'transaction_id_masspay'] : $strAliasPrefix . 'transaction_id_masspay';
			$objToReturn->strTransactionIdMasspay = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'transaction_id_paypal', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'transaction_id_paypal'] : $strAliasPrefix . 'transaction_id_paypal';
			$objToReturn->strTransactionIdPaypal = $objDbRow->GetColumn($strAliasName, 'VarChar');
			$strAliasName = array_key_exists($strAliasPrefix . 'status', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'status'] : $strAliasPrefix . 'status';
			$objToReturn->intStatus = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'amount'] : $strAliasPrefix . 'amount';
			$objToReturn->intAmount = $objDbRow->GetColumn($strAliasName, 'Integer');
			$strAliasName = array_key_exists($strAliasPrefix . 'returned_amount', $strColumnAliasArray) ? $strColumnAliasArray[$strAliasPrefix . 'returned_amount'] : $strAliasPrefix . 'returned_amount';
			$objToReturn->intReturnedAmount = $objDbRow->GetColumn($strAliasName, 'Integer');

			if (isset($arrPreviousItems) && is_array($arrPreviousItems)) {
				foreach ($arrPreviousItems as $objPreviousItem) {
					if ($objToReturn->Id != $objPreviousItem->Id) {
						continue;
					}

					// complete match - all primary key columns are the same
					return null;
				}
			}

			// Instantiate Virtual Attributes
			foreach ($objDbRow->GetColumnNameArray() as $strColumnName => $mixValue) {
				$strVirtualPrefix = $strAliasPrefix . '__';
				$strVirtualPrefixLength = strlen($strVirtualPrefix);
				if (substr($strColumnName, 0, $strVirtualPrefixLength) == $strVirtualPrefix)
					$objToReturn->__strVirtualAttributeArray[substr($strColumnName, $strVirtualPrefixLength)] = $mixValue;
			}

			// Prepare to Check for Early/Virtual Binding
			if (!$strAliasPrefix)
				$strAliasPrefix = 'table_paypal_request_out__';

			// Check for User Early Binding
			$strAlias = $strAliasPrefix . 'user_id__id';
			$strAliasName = array_key_exists($strAlias, $strColumnAliasArray) ? $strColumnAliasArray[$strAlias] : $strAlias;
			if (!is_null($objDbRow->GetColumn($strAliasName)))
				$objToReturn->objUser = TableUserProject::InstantiateDbRow($objDbRow, $strAliasPrefix . 'user_id__', $strExpandAsArrayNodes, null, $strColumnAliasArray);




			return $objToReturn;
		}

		/**
		 * Instantiate an array of TablePaypalRequestOuts from a Database Result
		 * @param DatabaseResultBase $objDbResult
		 * @param string $strExpandAsArrayNodes
		 * @param string[] $strColumnAliasArray
		 * @return TablePaypalRequestOut[]
		 */
		public static function InstantiateDbResult(QDatabaseResultBase $objDbResult, $strExpandAsArrayNodes = null, $strColumnAliasArray = null) {
			$objToReturn = array();
			
			if (!$strColumnAliasArray)
				$strColumnAliasArray = array();

			// If blank resultset, then return empty array
			if (!$objDbResult)
				return $objToReturn;

			// Load up the return array with each row
			if ($strExpandAsArrayNodes) {
				$objToReturn = array();
				while ($objDbRow = $objDbResult->GetNextRow()) {
					$objItem = TablePaypalRequestOut::InstantiateDbRow($objDbRow, null, $strExpandAsArrayNodes, $objToReturn, $strColumnAliasArray);
					if ($objItem) {
						$objToReturn[] = $objItem;
					}
				}
			} else {
				while ($objDbRow = $objDbResult->GetNextRow())
					$objToReturn[] = TablePaypalRequestOut::InstantiateDbRow($objDbRow, null, null, null, $strColumnAliasArray);
			}

			return $objToReturn;
		}



		///////////////////////////////////////////////////
		// INDEX-BASED LOAD METHODS (Single Load and Array)
		///////////////////////////////////////////////////
			
		/**
		 * Load a single TablePaypalRequestOut object,
		 * by Id Index(es)
		 * @param integer $intId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut
		*/
		public static function LoadById($intId, $objOptionalClauses = null) {
			return TablePaypalRequestOut::QuerySingle(
				QQ::AndCondition(
					QQ::Equal(QQN::TablePaypalRequestOut()->Id, $intId)
				),
				$objOptionalClauses
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by TransactionId Index(es)
		 * @param integer $intTransactionId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByTransactionId($intTransactionId, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByTransactionId query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->TransactionId, $intTransactionId),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by TransactionId Index(es)
		 * @param integer $intTransactionId
		 * @return int
		*/
		public static function CountByTransactionId($intTransactionId) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByTransactionId query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->TransactionId, $intTransactionId)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by ProcessTransactionId Index(es)
		 * @param integer $intProcessTransactionId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByProcessTransactionId($intProcessTransactionId, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByProcessTransactionId query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->ProcessTransactionId, $intProcessTransactionId),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by ProcessTransactionId Index(es)
		 * @param integer $intProcessTransactionId
		 * @return int
		*/
		public static function CountByProcessTransactionId($intProcessTransactionId) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByProcessTransactionId query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->ProcessTransactionId, $intProcessTransactionId)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by UserId Index(es)
		 * @param integer $intUserId
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByUserId($intUserId, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByUserId query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->UserId, $intUserId),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by UserId Index(es)
		 * @param integer $intUserId
		 * @return int
		*/
		public static function CountByUserId($intUserId) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByUserId query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->UserId, $intUserId)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by Currency Index(es)
		 * @param integer $intCurrency
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByCurrency($intCurrency, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByCurrency query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->Currency, $intCurrency),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by Currency Index(es)
		 * @param integer $intCurrency
		 * @return int
		*/
		public static function CountByCurrency($intCurrency) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByCurrency query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->Currency, $intCurrency)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by FeePaypal Index(es)
		 * @param integer $intFeePaypal
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByFeePaypal($intFeePaypal, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByFeePaypal query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->FeePaypal, $intFeePaypal),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by FeePaypal Index(es)
		 * @param integer $intFeePaypal
		 * @return int
		*/
		public static function CountByFeePaypal($intFeePaypal) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByFeePaypal query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->FeePaypal, $intFeePaypal)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by PaypalEmail Index(es)
		 * @param string $strPaypalEmail
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByPaypalEmail($strPaypalEmail, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByPaypalEmail query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->PaypalEmail, $strPaypalEmail),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by PaypalEmail Index(es)
		 * @param string $strPaypalEmail
		 * @return int
		*/
		public static function CountByPaypalEmail($strPaypalEmail) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByPaypalEmail query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->PaypalEmail, $strPaypalEmail)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by Username Index(es)
		 * @param string $strUsername
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByUsername($strUsername, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByUsername query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->Username, $strUsername),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by Username Index(es)
		 * @param string $strUsername
		 * @return int
		*/
		public static function CountByUsername($strUsername) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByUsername query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->Username, $strUsername)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by RequestDate Index(es)
		 * @param QDateTime $dttRequestDate
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByRequestDate($dttRequestDate, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByRequestDate query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->RequestDate, $dttRequestDate),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by RequestDate Index(es)
		 * @param QDateTime $dttRequestDate
		 * @return int
		*/
		public static function CountByRequestDate($dttRequestDate) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByRequestDate query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->RequestDate, $dttRequestDate)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by ProcessDate Index(es)
		 * @param QDateTime $dttProcessDate
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByProcessDate($dttProcessDate, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByProcessDate query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->ProcessDate, $dttProcessDate),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by ProcessDate Index(es)
		 * @param QDateTime $dttProcessDate
		 * @return int
		*/
		public static function CountByProcessDate($dttProcessDate) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByProcessDate query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->ProcessDate, $dttProcessDate)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by TransactionIdMasspay Index(es)
		 * @param string $strTransactionIdMasspay
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByTransactionIdMasspay($strTransactionIdMasspay, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByTransactionIdMasspay query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->TransactionIdMasspay, $strTransactionIdMasspay),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by TransactionIdMasspay Index(es)
		 * @param string $strTransactionIdMasspay
		 * @return int
		*/
		public static function CountByTransactionIdMasspay($strTransactionIdMasspay) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByTransactionIdMasspay query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->TransactionIdMasspay, $strTransactionIdMasspay)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by TransactionIdPaypal Index(es)
		 * @param string $strTransactionIdPaypal
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByTransactionIdPaypal($strTransactionIdPaypal, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByTransactionIdPaypal query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->TransactionIdPaypal, $strTransactionIdPaypal),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by TransactionIdPaypal Index(es)
		 * @param string $strTransactionIdPaypal
		 * @return int
		*/
		public static function CountByTransactionIdPaypal($strTransactionIdPaypal) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByTransactionIdPaypal query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->TransactionIdPaypal, $strTransactionIdPaypal)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by Status Index(es)
		 * @param integer $intStatus
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByStatus($intStatus, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByStatus query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->Status, $intStatus),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by Status Index(es)
		 * @param integer $intStatus
		 * @return int
		*/
		public static function CountByStatus($intStatus) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByStatus query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->Status, $intStatus)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by AmountWithdrawFromSite Index(es)
		 * @param integer $intAmountWithdrawFromSite
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByAmountWithdrawFromSite($intAmountWithdrawFromSite, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByAmountWithdrawFromSite query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->AmountWithdrawFromSite, $intAmountWithdrawFromSite),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by AmountWithdrawFromSite Index(es)
		 * @param integer $intAmountWithdrawFromSite
		 * @return int
		*/
		public static function CountByAmountWithdrawFromSite($intAmountWithdrawFromSite) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByAmountWithdrawFromSite query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->AmountWithdrawFromSite, $intAmountWithdrawFromSite)
			);
		}
			
		/**
		 * Load an array of TablePaypalRequestOut objects,
		 * by AmountWithdrawFromPaypalAccount Index(es)
		 * @param integer $intAmountWithdrawFromPaypalAccount
		 * @param QQClause[] $objOptionalClauses additional optional QQClause objects for this query
		 * @return TablePaypalRequestOut[]
		*/
		public static function LoadArrayByAmountWithdrawFromPaypalAccount($intAmountWithdrawFromPaypalAccount, $objOptionalClauses = null) {
			// Call TablePaypalRequestOut::QueryArray to perform the LoadArrayByAmountWithdrawFromPaypalAccount query
			try {
				return TablePaypalRequestOut::QueryArray(
					QQ::Equal(QQN::TablePaypalRequestOut()->AmountWithdrawFromPaypalAccount, $intAmountWithdrawFromPaypalAccount),
					$objOptionalClauses);
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * Count TablePaypalRequestOuts
		 * by AmountWithdrawFromPaypalAccount Index(es)
		 * @param integer $intAmountWithdrawFromPaypalAccount
		 * @return int
		*/
		public static function CountByAmountWithdrawFromPaypalAccount($intAmountWithdrawFromPaypalAccount) {
			// Call TablePaypalRequestOut::QueryCount to perform the CountByAmountWithdrawFromPaypalAccount query
			return TablePaypalRequestOut::QueryCount(
				QQ::Equal(QQN::TablePaypalRequestOut()->AmountWithdrawFromPaypalAccount, $intAmountWithdrawFromPaypalAccount)
			);
		}



		////////////////////////////////////////////////////
		// INDEX-BASED LOAD METHODS (Array via Many to Many)
		////////////////////////////////////////////////////




		//////////////////////////
		// SAVE, DELETE AND RELOAD
		//////////////////////////

		/**
		 * Save this TablePaypalRequestOut
		 * @param bool $blnForceInsert
		 * @param bool $blnForceUpdate
		 * @return int
		 */
		public function Save($blnForceInsert = false, $blnForceUpdate = false) {
			// Get the Database Object for this Class
			$objDatabase = TablePaypalRequestOut::GetDatabase();

			$mixToReturn = null;

			try {
				if ((!$this->__blnRestored) || ($blnForceInsert)) {
					// Perform an INSERT query
					$objDatabase->NonQuery('
						INSERT INTO `table_paypal_request_out` (
							`transaction_id`,
							`process_transaction_id`,
							`user_id`,
							`currency`,
							`amount_withdraw_from_site`,
							`amount_withdraw_from_paypal_account`,
							`fee_paypal`,
							`paypal_email`,
							`username`,
							`request_date`,
							`process_date`,
							`transaction_id_masspay`,
							`transaction_id_paypal`,
							`status`,
							`amount`,
							`returned_amount`
						) VALUES (
							' . $objDatabase->SqlVariable($this->intTransactionId) . ',
							' . $objDatabase->SqlVariable($this->intProcessTransactionId) . ',
							' . $objDatabase->SqlVariable($this->intUserId) . ',
							' . $objDatabase->SqlVariable($this->intCurrency) . ',
							' . $objDatabase->SqlVariable($this->intAmountWithdrawFromSite) . ',
							' . $objDatabase->SqlVariable($this->intAmountWithdrawFromPaypalAccount) . ',
							' . $objDatabase->SqlVariable($this->intFeePaypal) . ',
							' . $objDatabase->SqlVariable($this->strPaypalEmail) . ',
							' . $objDatabase->SqlVariable($this->strUsername) . ',
							' . $objDatabase->SqlVariable($this->dttRequestDate) . ',
							' . $objDatabase->SqlVariable($this->dttProcessDate) . ',
							' . $objDatabase->SqlVariable($this->strTransactionIdMasspay) . ',
							' . $objDatabase->SqlVariable($this->strTransactionIdPaypal) . ',
							' . $objDatabase->SqlVariable($this->intStatus) . ',
							' . $objDatabase->SqlVariable($this->intAmount) . ',
							' . $objDatabase->SqlVariable($this->intReturnedAmount) . '
						)
					');

					// Update Identity column and return its value
					$mixToReturn = $this->intId = $objDatabase->InsertId('table_paypal_request_out', 'id');
				} else {
					// Perform an UPDATE query

					// First checking for Optimistic Locking constraints (if applicable)

					// Perform the UPDATE query
					$objDatabase->NonQuery('
						UPDATE
							`table_paypal_request_out`
						SET
							`transaction_id` = ' . $objDatabase->SqlVariable($this->intTransactionId) . ',
							`process_transaction_id` = ' . $objDatabase->SqlVariable($this->intProcessTransactionId) . ',
							`user_id` = ' . $objDatabase->SqlVariable($this->intUserId) . ',
							`currency` = ' . $objDatabase->SqlVariable($this->intCurrency) . ',
							`amount_withdraw_from_site` = ' . $objDatabase->SqlVariable($this->intAmountWithdrawFromSite) . ',
							`amount_withdraw_from_paypal_account` = ' . $objDatabase->SqlVariable($this->intAmountWithdrawFromPaypalAccount) . ',
							`fee_paypal` = ' . $objDatabase->SqlVariable($this->intFeePaypal) . ',
							`paypal_email` = ' . $objDatabase->SqlVariable($this->strPaypalEmail) . ',
							`username` = ' . $objDatabase->SqlVariable($this->strUsername) . ',
							`request_date` = ' . $objDatabase->SqlVariable($this->dttRequestDate) . ',
							`process_date` = ' . $objDatabase->SqlVariable($this->dttProcessDate) . ',
							`transaction_id_masspay` = ' . $objDatabase->SqlVariable($this->strTransactionIdMasspay) . ',
							`transaction_id_paypal` = ' . $objDatabase->SqlVariable($this->strTransactionIdPaypal) . ',
							`status` = ' . $objDatabase->SqlVariable($this->intStatus) . ',
							`amount` = ' . $objDatabase->SqlVariable($this->intAmount) . ',
							`returned_amount` = ' . $objDatabase->SqlVariable($this->intReturnedAmount) . '
						WHERE
							`id` = ' . $objDatabase->SqlVariable($this->intId) . '
					');
				}

			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}

			// Update __blnRestored and any Non-Identity PK Columns (if applicable)
			$this->__blnRestored = true;


			// Return 
			return $mixToReturn;
		}

		/**
		 * Delete this TablePaypalRequestOut
		 * @return void
		 */
		public function Delete() {
			if ((is_null($this->intId)))
				throw new QUndefinedPrimaryKeyException('Cannot delete this TablePaypalRequestOut with an unset primary key.');

			// Get the Database Object for this Class
			$objDatabase = TablePaypalRequestOut::GetDatabase();


			// Perform the SQL Query
			$objDatabase->NonQuery('
				DELETE FROM
					`table_paypal_request_out`
				WHERE
					`id` = ' . $objDatabase->SqlVariable($this->intId) . '');
		}

		/**
		 * Delete all TablePaypalRequestOuts
		 * @return void
		 */
		public static function DeleteAll() {
			// Get the Database Object for this Class
			$objDatabase = TablePaypalRequestOut::GetDatabase();

			// Perform the Query
			$objDatabase->NonQuery('
				DELETE FROM
					`table_paypal_request_out`');
		}

		/**
		 * Truncate table_paypal_request_out table
		 * @return void
		 */
		public static function Truncate() {
			// Get the Database Object for this Class
			$objDatabase = TablePaypalRequestOut::GetDatabase();

			// Perform the Query
			$objDatabase->NonQuery('
				TRUNCATE `table_paypal_request_out`');
		}

		/**
		 * Reload this TablePaypalRequestOut from the database.
		 * @return void
		 */
		public function Reload() {
			// Make sure we are actually Restored from the database
			if (!$this->__blnRestored)
				throw new QCallerException('Cannot call Reload() on a new, unsaved TablePaypalRequestOut object.');

			// Reload the Object
			$objReloaded = TablePaypalRequestOut::Load($this->intId);

			// Update $this's local variables to match
			$this->intTransactionId = $objReloaded->intTransactionId;
			$this->intProcessTransactionId = $objReloaded->intProcessTransactionId;
			$this->UserId = $objReloaded->UserId;
			$this->intCurrency = $objReloaded->intCurrency;
			$this->intAmountWithdrawFromSite = $objReloaded->intAmountWithdrawFromSite;
			$this->intAmountWithdrawFromPaypalAccount = $objReloaded->intAmountWithdrawFromPaypalAccount;
			$this->intFeePaypal = $objReloaded->intFeePaypal;
			$this->strPaypalEmail = $objReloaded->strPaypalEmail;
			$this->strUsername = $objReloaded->strUsername;
			$this->dttRequestDate = $objReloaded->dttRequestDate;
			$this->dttProcessDate = $objReloaded->dttProcessDate;
			$this->strTransactionIdMasspay = $objReloaded->strTransactionIdMasspay;
			$this->strTransactionIdPaypal = $objReloaded->strTransactionIdPaypal;
			$this->intStatus = $objReloaded->intStatus;
			$this->intAmount = $objReloaded->intAmount;
			$this->intReturnedAmount = $objReloaded->intReturnedAmount;
		}



		////////////////////
		// PUBLIC OVERRIDERS
		////////////////////

				/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				///////////////////
				// Member Variables
				///////////////////
				case 'Id':
					/**
					 * Gets the value for intId (Read-Only PK)
					 * @return integer
					 */
					return $this->intId;

				case 'TransactionId':
					/**
					 * Gets the value for intTransactionId 
					 * @return integer
					 */
					return $this->intTransactionId;

				case 'ProcessTransactionId':
					/**
					 * Gets the value for intProcessTransactionId 
					 * @return integer
					 */
					return $this->intProcessTransactionId;

				case 'UserId':
					/**
					 * Gets the value for intUserId (Not Null)
					 * @return integer
					 */
					return $this->intUserId;

				case 'Currency':
					/**
					 * Gets the value for intCurrency (Not Null)
					 * @return integer
					 */
					return $this->intCurrency;

				case 'AmountWithdrawFromSite':
					/**
					 * Gets the value for intAmountWithdrawFromSite (Not Null)
					 * @return integer
					 */
					return $this->intAmountWithdrawFromSite;

				case 'AmountWithdrawFromPaypalAccount':
					/**
					 * Gets the value for intAmountWithdrawFromPaypalAccount (Not Null)
					 * @return integer
					 */
					return $this->intAmountWithdrawFromPaypalAccount;

				case 'FeePaypal':
					/**
					 * Gets the value for intFeePaypal (Not Null)
					 * @return integer
					 */
					return $this->intFeePaypal;

				case 'PaypalEmail':
					/**
					 * Gets the value for strPaypalEmail (Not Null)
					 * @return string
					 */
					return $this->strPaypalEmail;

				case 'Username':
					/**
					 * Gets the value for strUsername (Not Null)
					 * @return string
					 */
					return $this->strUsername;

				case 'RequestDate':
					/**
					 * Gets the value for dttRequestDate 
					 * @return QDateTime
					 */
					return $this->dttRequestDate;

				case 'ProcessDate':
					/**
					 * Gets the value for dttProcessDate 
					 * @return QDateTime
					 */
					return $this->dttProcessDate;

				case 'TransactionIdMasspay':
					/**
					 * Gets the value for strTransactionIdMasspay 
					 * @return string
					 */
					return $this->strTransactionIdMasspay;

				case 'TransactionIdPaypal':
					/**
					 * Gets the value for strTransactionIdPaypal 
					 * @return string
					 */
					return $this->strTransactionIdPaypal;

				case 'Status':
					/**
					 * Gets the value for intStatus (Not Null)
					 * @return integer
					 */
					return $this->intStatus;

				case 'Amount':
					/**
					 * Gets the value for intAmount (Not Null)
					 * @return integer
					 */
					return $this->intAmount;

				case 'ReturnedAmount':
					/**
					 * Gets the value for intReturnedAmount 
					 * @return integer
					 */
					return $this->intReturnedAmount;


				///////////////////
				// Member Objects
				///////////////////
				case 'User':
					/**
					 * Gets the value for the TableUserProject object referenced by intUserId (Not Null)
					 * @return TableUserProject
					 */
					try {
						if ((!$this->objUser) && (!is_null($this->intUserId)))
							$this->objUser = TableUserProject::Load($this->intUserId);
						return $this->objUser;
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}


				////////////////////////////
				// Virtual Object References (Many to Many and Reverse References)
				// (If restored via a "Many-to" expansion)
				////////////////////////////


				case '__Restored':
					return $this->__blnRestored;

				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

				/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			switch ($strName) {
				///////////////////
				// Member Variables
				///////////////////
				case 'TransactionId':
					/**
					 * Sets the value for intTransactionId 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intTransactionId = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'ProcessTransactionId':
					/**
					 * Sets the value for intProcessTransactionId 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intProcessTransactionId = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'UserId':
					/**
					 * Sets the value for intUserId (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						$this->objUser = null;
						return ($this->intUserId = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Currency':
					/**
					 * Sets the value for intCurrency (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intCurrency = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'AmountWithdrawFromSite':
					/**
					 * Sets the value for intAmountWithdrawFromSite (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intAmountWithdrawFromSite = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'AmountWithdrawFromPaypalAccount':
					/**
					 * Sets the value for intAmountWithdrawFromPaypalAccount (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intAmountWithdrawFromPaypalAccount = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'FeePaypal':
					/**
					 * Sets the value for intFeePaypal (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intFeePaypal = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'PaypalEmail':
					/**
					 * Sets the value for strPaypalEmail (Not Null)
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strPaypalEmail = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Username':
					/**
					 * Sets the value for strUsername (Not Null)
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strUsername = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'RequestDate':
					/**
					 * Sets the value for dttRequestDate 
					 * @param QDateTime $mixValue
					 * @return QDateTime
					 */
					try {
						return ($this->dttRequestDate = QType::Cast($mixValue, QType::DateTime));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'ProcessDate':
					/**
					 * Sets the value for dttProcessDate 
					 * @param QDateTime $mixValue
					 * @return QDateTime
					 */
					try {
						return ($this->dttProcessDate = QType::Cast($mixValue, QType::DateTime));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'TransactionIdMasspay':
					/**
					 * Sets the value for strTransactionIdMasspay 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strTransactionIdMasspay = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'TransactionIdPaypal':
					/**
					 * Sets the value for strTransactionIdPaypal 
					 * @param string $mixValue
					 * @return string
					 */
					try {
						return ($this->strTransactionIdPaypal = QType::Cast($mixValue, QType::String));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Status':
					/**
					 * Sets the value for intStatus (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intStatus = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'Amount':
					/**
					 * Sets the value for intAmount (Not Null)
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intAmount = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}

				case 'ReturnedAmount':
					/**
					 * Sets the value for intReturnedAmount 
					 * @param integer $mixValue
					 * @return integer
					 */
					try {
						return ($this->intReturnedAmount = QType::Cast($mixValue, QType::Integer));
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}


				///////////////////
				// Member Objects
				///////////////////
				case 'User':
					/**
					 * Sets the value for the TableUserProject object referenced by intUserId (Not Null)
					 * @param TableUserProject $mixValue
					 * @return TableUserProject
					 */
					if (is_null($mixValue)) {
						$this->intUserId = null;
						$this->objUser = null;
						return null;
					} else {
						// Make sure $mixValue actually is a TableUserProject object
						try {
							$mixValue = QType::Cast($mixValue, 'TableUserProject');
						} catch (QInvalidCastException $objExc) {
							$objExc->IncrementOffset();
							throw $objExc;
						} 

						// Make sure $mixValue is a SAVED TableUserProject object
						if (is_null($mixValue->Id))
							throw new QCallerException('Unable to set an unsaved User for this TablePaypalRequestOut');

						// Update Local Member Variables
						$this->objUser = $mixValue;
						$this->intUserId = $mixValue->Id;

						// Return $mixValue
						return $mixValue;
					}
					break;

				default:
					try {
						return parent::__set($strName, $mixValue);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Lookup a VirtualAttribute value (if applicable).  Returns NULL if none found.
		 * @param string $strName
		 * @return string
		 */
		public function GetVirtualAttribute($strName) {
			if (array_key_exists($strName, $this->__strVirtualAttributeArray))
				return $this->__strVirtualAttributeArray[$strName];
			return null;
		}



		///////////////////////////////
		// ASSOCIATED OBJECTS' METHODS
		///////////////////////////////





		////////////////////////////////////////
		// METHODS for SOAP-BASED WEB SERVICES
		////////////////////////////////////////

		public static function GetSoapComplexTypeXml() {
			$strToReturn = '<complexType name="TablePaypalRequestOut"><sequence>';
			$strToReturn .= '<element name="Id" type="xsd:int"/>';
			$strToReturn .= '<element name="TransactionId" type="xsd:int"/>';
			$strToReturn .= '<element name="ProcessTransactionId" type="xsd:int"/>';
			$strToReturn .= '<element name="User" type="xsd1:TableUserProject"/>';
			$strToReturn .= '<element name="Currency" type="xsd:int"/>';
			$strToReturn .= '<element name="AmountWithdrawFromSite" type="xsd:int"/>';
			$strToReturn .= '<element name="AmountWithdrawFromPaypalAccount" type="xsd:int"/>';
			$strToReturn .= '<element name="FeePaypal" type="xsd:int"/>';
			$strToReturn .= '<element name="PaypalEmail" type="xsd:string"/>';
			$strToReturn .= '<element name="Username" type="xsd:string"/>';
			$strToReturn .= '<element name="RequestDate" type="xsd:dateTime"/>';
			$strToReturn .= '<element name="ProcessDate" type="xsd:dateTime"/>';
			$strToReturn .= '<element name="TransactionIdMasspay" type="xsd:string"/>';
			$strToReturn .= '<element name="TransactionIdPaypal" type="xsd:string"/>';
			$strToReturn .= '<element name="Status" type="xsd:int"/>';
			$strToReturn .= '<element name="Amount" type="xsd:int"/>';
			$strToReturn .= '<element name="ReturnedAmount" type="xsd:int"/>';
			$strToReturn .= '<element name="__blnRestored" type="xsd:boolean"/>';
			$strToReturn .= '</sequence></complexType>';
			return $strToReturn;
		}

		public static function AlterSoapComplexTypeArray(&$strComplexTypeArray) {
			if (!array_key_exists('TablePaypalRequestOut', $strComplexTypeArray)) {
				$strComplexTypeArray['TablePaypalRequestOut'] = TablePaypalRequestOut::GetSoapComplexTypeXml();
				TableUserProject::AlterSoapComplexTypeArray($strComplexTypeArray);
			}
		}

		public static function GetArrayFromSoapArray($objSoapArray) {
			$objArrayToReturn = array();

			foreach ($objSoapArray as $objSoapObject)
				array_push($objArrayToReturn, TablePaypalRequestOut::GetObjectFromSoapObject($objSoapObject));

			return $objArrayToReturn;
		}

		public static function GetObjectFromSoapObject($objSoapObject) {
			$objToReturn = new TablePaypalRequestOut();
			if (property_exists($objSoapObject, 'Id'))
				$objToReturn->intId = $objSoapObject->Id;
			if (property_exists($objSoapObject, 'TransactionId'))
				$objToReturn->intTransactionId = $objSoapObject->TransactionId;
			if (property_exists($objSoapObject, 'ProcessTransactionId'))
				$objToReturn->intProcessTransactionId = $objSoapObject->ProcessTransactionId;
			if ((property_exists($objSoapObject, 'User')) &&
				($objSoapObject->User))
				$objToReturn->User = TableUserProject::GetObjectFromSoapObject($objSoapObject->User);
			if (property_exists($objSoapObject, 'Currency'))
				$objToReturn->intCurrency = $objSoapObject->Currency;
			if (property_exists($objSoapObject, 'AmountWithdrawFromSite'))
				$objToReturn->intAmountWithdrawFromSite = $objSoapObject->AmountWithdrawFromSite;
			if (property_exists($objSoapObject, 'AmountWithdrawFromPaypalAccount'))
				$objToReturn->intAmountWithdrawFromPaypalAccount = $objSoapObject->AmountWithdrawFromPaypalAccount;
			if (property_exists($objSoapObject, 'FeePaypal'))
				$objToReturn->intFeePaypal = $objSoapObject->FeePaypal;
			if (property_exists($objSoapObject, 'PaypalEmail'))
				$objToReturn->strPaypalEmail = $objSoapObject->PaypalEmail;
			if (property_exists($objSoapObject, 'Username'))
				$objToReturn->strUsername = $objSoapObject->Username;
			if (property_exists($objSoapObject, 'RequestDate'))
				$objToReturn->dttRequestDate = new QDateTime($objSoapObject->RequestDate);
			if (property_exists($objSoapObject, 'ProcessDate'))
				$objToReturn->dttProcessDate = new QDateTime($objSoapObject->ProcessDate);
			if (property_exists($objSoapObject, 'TransactionIdMasspay'))
				$objToReturn->strTransactionIdMasspay = $objSoapObject->TransactionIdMasspay;
			if (property_exists($objSoapObject, 'TransactionIdPaypal'))
				$objToReturn->strTransactionIdPaypal = $objSoapObject->TransactionIdPaypal;
			if (property_exists($objSoapObject, 'Status'))
				$objToReturn->intStatus = $objSoapObject->Status;
			if (property_exists($objSoapObject, 'Amount'))
				$objToReturn->intAmount = $objSoapObject->Amount;
			if (property_exists($objSoapObject, 'ReturnedAmount'))
				$objToReturn->intReturnedAmount = $objSoapObject->ReturnedAmount;
			if (property_exists($objSoapObject, '__blnRestored'))
				$objToReturn->__blnRestored = $objSoapObject->__blnRestored;
			return $objToReturn;
		}

		public static function GetSoapArrayFromArray($objArray) {
			if (!$objArray)
				return null;

			$objArrayToReturn = array();

			foreach ($objArray as $objObject)
				array_push($objArrayToReturn, TablePaypalRequestOut::GetSoapObjectFromObject($objObject, true));

			return unserialize(serialize($objArrayToReturn));
		}

		public static function GetSoapObjectFromObject($objObject, $blnBindRelatedObjects) {
			if ($objObject->objUser)
				$objObject->objUser = TableUserProject::GetSoapObjectFromObject($objObject->objUser, false);
			else if (!$blnBindRelatedObjects)
				$objObject->intUserId = null;
			if ($objObject->dttRequestDate)
				$objObject->dttRequestDate = $objObject->dttRequestDate->__toString(QDateTime::FormatSoap);
			if ($objObject->dttProcessDate)
				$objObject->dttProcessDate = $objObject->dttProcessDate->__toString(QDateTime::FormatSoap);
			return $objObject;
		}




	}



	/////////////////////////////////////
	// ADDITIONAL CLASSES for QCubed QUERY
	/////////////////////////////////////

	class QQNodeTablePaypalRequestOut extends QQNode {
		protected $strTableName = 'table_paypal_request_out';
		protected $strPrimaryKey = 'id';
		protected $strClassName = 'TablePaypalRequestOut';
		public function __get($strName) {
			switch ($strName) {
				case 'Id':
					return new QQNode('id', 'Id', 'integer', $this);
				case 'TransactionId':
					return new QQNode('transaction_id', 'TransactionId', 'integer', $this);
				case 'ProcessTransactionId':
					return new QQNode('process_transaction_id', 'ProcessTransactionId', 'integer', $this);
				case 'UserId':
					return new QQNode('user_id', 'UserId', 'integer', $this);
				case 'User':
					return new QQNodeTableUserProject('user_id', 'User', 'integer', $this);
				case 'Currency':
					return new QQNode('currency', 'Currency', 'integer', $this);
				case 'AmountWithdrawFromSite':
					return new QQNode('amount_withdraw_from_site', 'AmountWithdrawFromSite', 'integer', $this);
				case 'AmountWithdrawFromPaypalAccount':
					return new QQNode('amount_withdraw_from_paypal_account', 'AmountWithdrawFromPaypalAccount', 'integer', $this);
				case 'FeePaypal':
					return new QQNode('fee_paypal', 'FeePaypal', 'integer', $this);
				case 'PaypalEmail':
					return new QQNode('paypal_email', 'PaypalEmail', 'string', $this);
				case 'Username':
					return new QQNode('username', 'Username', 'string', $this);
				case 'RequestDate':
					return new QQNode('request_date', 'RequestDate', 'QDateTime', $this);
				case 'ProcessDate':
					return new QQNode('process_date', 'ProcessDate', 'QDateTime', $this);
				case 'TransactionIdMasspay':
					return new QQNode('transaction_id_masspay', 'TransactionIdMasspay', 'string', $this);
				case 'TransactionIdPaypal':
					return new QQNode('transaction_id_paypal', 'TransactionIdPaypal', 'string', $this);
				case 'Status':
					return new QQNode('status', 'Status', 'integer', $this);
				case 'Amount':
					return new QQNode('amount', 'Amount', 'integer', $this);
				case 'ReturnedAmount':
					return new QQNode('returned_amount', 'ReturnedAmount', 'integer', $this);

				case '_PrimaryKeyNode':
					return new QQNode('id', 'Id', 'integer', $this);
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}
	}

	class QQReverseReferenceNodeTablePaypalRequestOut extends QQReverseReferenceNode {
		protected $strTableName = 'table_paypal_request_out';
		protected $strPrimaryKey = 'id';
		protected $strClassName = 'TablePaypalRequestOut';
		public function __get($strName) {
			switch ($strName) {
				case 'Id':
					return new QQNode('id', 'Id', 'integer', $this);
				case 'TransactionId':
					return new QQNode('transaction_id', 'TransactionId', 'integer', $this);
				case 'ProcessTransactionId':
					return new QQNode('process_transaction_id', 'ProcessTransactionId', 'integer', $this);
				case 'UserId':
					return new QQNode('user_id', 'UserId', 'integer', $this);
				case 'User':
					return new QQNodeTableUserProject('user_id', 'User', 'integer', $this);
				case 'Currency':
					return new QQNode('currency', 'Currency', 'integer', $this);
				case 'AmountWithdrawFromSite':
					return new QQNode('amount_withdraw_from_site', 'AmountWithdrawFromSite', 'integer', $this);
				case 'AmountWithdrawFromPaypalAccount':
					return new QQNode('amount_withdraw_from_paypal_account', 'AmountWithdrawFromPaypalAccount', 'integer', $this);
				case 'FeePaypal':
					return new QQNode('fee_paypal', 'FeePaypal', 'integer', $this);
				case 'PaypalEmail':
					return new QQNode('paypal_email', 'PaypalEmail', 'string', $this);
				case 'Username':
					return new QQNode('username', 'Username', 'string', $this);
				case 'RequestDate':
					return new QQNode('request_date', 'RequestDate', 'QDateTime', $this);
				case 'ProcessDate':
					return new QQNode('process_date', 'ProcessDate', 'QDateTime', $this);
				case 'TransactionIdMasspay':
					return new QQNode('transaction_id_masspay', 'TransactionIdMasspay', 'string', $this);
				case 'TransactionIdPaypal':
					return new QQNode('transaction_id_paypal', 'TransactionIdPaypal', 'string', $this);
				case 'Status':
					return new QQNode('status', 'Status', 'integer', $this);
				case 'Amount':
					return new QQNode('amount', 'Amount', 'integer', $this);
				case 'ReturnedAmount':
					return new QQNode('returned_amount', 'ReturnedAmount', 'integer', $this);

				case '_PrimaryKeyNode':
					return new QQNode('id', 'Id', 'integer', $this);
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}
	}

?>